package com.syh.controller;

import com.syh.pojo.Orders;
import com.syh.pojo.Shop;
import com.syh.service.OrderService;
import com.syh.service.ShopService;
import com.syh.utils.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author syh
 * @date 2023/3/23-17:58
 */
@SuppressWarnings("all")
@RestController
@Api(value ="订单管理",tags = {"定单管理接口"})
@RequestMapping("/order")
public class OrderController {
    @Autowired
    OrderService orderService;
    @PostMapping("/selectAllOrder")
    @ApiOperation(value = "查询订单")
    public Result selectchukusjByPage(){
        //分页查询商品列表
        try {
            List<Orders> orderList = orderService.selectAll();
            return Result.ok(orderList);
        } catch (Exception e) {
            e.printStackTrace();
            return Result.error("查詢失敗");
        }
    }
}
